#include <iostream>
#include <map>
using namespace std;
int main()
{
    string s;
    cin >> s;
    if (s.size() == 6)
    {
        cout << s[0] << s[1] << s[2] << s[3] << "-" << s[4] << s[5];
    }
    else
    {
        int a = s[0] - '0';
        int b = s[1] - '0';
        int c = s[2] - '0';
        int d = s[3] - '0';
        int x = a * 10 + b;
        int y = c * 10 + d;
        if (x < 22)
        {
            cout << "20" << s[0] << s[1] << "-";
            if (y >= 10)
                cout << y;
            else
            {
                cout << s[2] << s[3];
            }
        }
        else
        {
            cout << "19" << s[0] << s[1] << "-";
            if (y >= 10)
                cout << y;
            else
            {
                cout << s[2] << s[3];
            }
        }
    }
}
